﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Core.Infarastructure.Structs;
using StackAttack_WindowsFormApp.Helper_Forms;
using StackAttack_WindowsFormApp.Helpers;

namespace StackAttack_WindowsFormApp
{
    public partial class MainApp : Form
    {
       
        public MainApp()
        {
            
            InitializeComponent();
            Pause.Image = Image.FromFile(PathFinder.GetFullPathToFile("Images\\pause_1.png"));

            this.DrawingBox.Image = Image.FromFile(PathFinder.GetFullPathToFile("Images\\logo.png"));
            this.BackgroundImage = Image.FromFile(PathFinder.GetFullPathToFile("Images\\background1.jpg"));
            
            
        }

        
        
        private void MainApp_Load(object sender, EventArgs e)
        {
            DrawingFieldStructure field = new DrawingFieldStructure();
            field.Width = DrawingBox.Width;
            field.Height = DrawingBox.Height;
            StackAttackManager.Start(this, DrawingBox.CreateGraphics(), field);

        }

        private void Pause_Click_1(object sender, EventArgs e)
        {
            StackAttackManager.Pause(this);
        }

        
        private void MainApp_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                this.Dispose();
                MenuForm menu = new MenuForm();
                menu.ShowDialog();
            }
        }

       

        

       

        
       
    }
}
